#ifndef TOPBARWIDGET_H
#define TOPBARWIDGET_H

#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QPushButton>
#include <QPixmap>

class TopbarWidget : public QWidget
{
    Q_OBJECT

public:
    explicit TopbarWidget(QWidget *parent = nullptr);
    ~TopbarWidget();

    void setLogo(const QString &logo);
    void setTitle(const QString &title);
    QString getTitle() const;
    void setPhoto(const QString &photo);
    void setUserInfo(const QString &userInfo);
    QString getUserInfo() const;
    void setStoveInfo(const QString &stoveInfo);
    QString getStoveInfo() const;

    void showSeparator(bool show);

signals:
    void exitRequested();

protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;

private:
    void setupUI();
    void setupConnections();
    
    // UI组件
    QHBoxLayout *m_mainLayout;
    QWidget *m_leftWidget;
    QLabel *m_logoLabel;
    QWidget *m_rightWidget;
    QLabel *m_photoLabel;
    QLabel *m_userLabel;
    QLabel *m_separatorLabel;
    QLabel *m_stoveLabel;
    QPushButton *m_exitButton;
    
    // 标题文本
    QString m_titleText;
};

#endif // TOPBARWIDGET_H
